geomerative
public class RMatrix extends java.lang.Object
| Constructor and Description |
|---|
RMatrix()
Create a new identity matrix.
|
RMatrix(float m00,
float m01,
float m02,
float m10,
float m11,
float m12)
Create a new matrix given the coefficients.
|
RMatrix(RMatrix src)
Copy a matrix.
|
RMatrix(java.lang.String transformationString) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(float n00,
float n01,
float n02,
float n10,
float n11,
float n12)
Multiply the matrix with another matrix.
|
void |
apply(RMatrix rhs)
Multiply the matrix with another matrix.
|
void |
rotate(float angle) |
void |
rotate(float angle,
float vx,
float vy)
Apply a rotation to the matrix, given an angle and optionally a rotation center.
|
void |
rotate(float angle,
RPoint v)
Apply a rotation to the matrix, given an angle and optionally a rotation center.
|
void |
scale(float s) |
void |
scale(float sx,
float sy) |
void |
scale(float s,
float x,
float y)
Apply a scale to the matrix, given scaling factors and optionally a scaling center.
|
void |
scale(float sx,
float sy,
float x,
float y)
Apply a scale to the matrix, given scaling factors and optionally a scaling center.
|
void |
scale(float sx,
float sy,
RPoint p)
Apply a scale to the matrix, given scaling factors and optionally a scaling center.
|
void |
scale(float s,
RPoint p)
Apply a scale to the matrix, given scaling factors and optionally a scaling center.
|
void |
shear(float shx,
float shy)
Use this to apply a shearing to the matrix.
|
void |
skewX(float angle)
Use this to apply a skewing to the matrix.
|
void |
skewY(float angle) |
void |
translate(float tx) |
void |
translate(float tx,
float ty)
Apply a translation to the matrix, given the coordinates.
|
void |
translate(RPoint t)
Apply a translation to the matrix, given a point.
|
public RMatrix(float m00,
float m01,
float m02,
float m10,
float m11,
float m12)
m00 - coefficient 00 of the matrixm01 - coefficient 01 of the matrixm02 - coefficient 02 of the matrixm10 - coefficient 10 of the matrixm11 - coefficient 11 of the matrixm12 - coefficient 12 of the matrixpublic RMatrix()
public RMatrix(RMatrix src)
src - source matrix from where to copy the matrixpublic RMatrix(java.lang.String transformationString)
public void apply(float n00,
float n01,
float n02,
float n10,
float n11,
float n12)
n00 - coefficient 00 of the matrix to be appliedn01 - coefficient 01 of the matrix to be appliedn02 - coefficient 02 of the matrix to be appliedn10 - coefficient 10 of the matrix to be appliedn11 - coefficient 11 of the matrix to be appliedn12 - coefficient 12 of the matrix to be appliedpublic void apply(RMatrix rhs)
rhs - right hand side matrixpublic void translate(float tx,
float ty)
tx - x coordinate translationty - y coordinate translationpublic void translate(float tx)
public void translate(RPoint t)
t - vector translationpublic void rotate(float angle,
float vx,
float vy)
angle - the angle of rotation to be appliedvx - the x coordinate of the center of rotationvy - the y coordinate of the center of rotationpublic void rotate(float angle)
public void rotate(float angle,
RPoint v)
angle - the angle of rotation to be appliedv - the position vector of the center of rotationpublic void scale(float sx,
float sy,
float x,
float y)
sx - the scaling coefficient over the x axissy - the scaling coefficient over the y axisx - x coordinate of the position vector of the center of the scalingy - y coordinate of the position vector of the center of the scalingpublic void scale(float sx,
float sy)
public void scale(float s,
float x,
float y)
s - the scaling coefficient for a uniform scalingx - x coordinate of the position vector of the center of the scalingy - y coordinate of the position vector of the center of the scalingpublic void scale(float sx,
float sy,
RPoint p)
sx - the scaling coefficient over the x axissy - the scaling coefficient over the y axisp - the position vector of the center of the scalingpublic void scale(float s,
RPoint p)
s - the scaling coefficient for a uniform scalingp - the position vector of the center of the scalingpublic void scale(float s)
public void skewX(float angle)
angle - skewing anglepublic void skewY(float angle)
public void shear(float shx,
float shy)
shx - x coordinate shearingshy - y coordinate shearingGeomerative by Ricard Marxer, http://www.ricardmarxer.com/geomerative/